#! /bin/sh
### 放到crontab里，每2分钟检查一次
#0-59/2 * * * * sh /home/maitreya/showxun_start.sh >>/tmp/showxun.fcgi.log

count=`ps -ef |grep "python showxun.fcgi" |grep -v "grep"|wc -l`
echo $(date),' curps ',$count
if [ $count -lt 1 ]
then
  echo $(date),' start showxun app'
  cd "$(dirname "$0")"
  python maitreya/showxun.fcgi method=prefork minspare=50 maxspare=50 maxchildren=1000 &
  ##chmod 777 /tmp/showxun_app.sock
fi
